 <html>
    <head>
		<link rel="shortcut icon" href="images/icon.png" rel="shortcut icon" href="images/icon.png" />
		<title>Atlas</title>
		<link rel="stylesheet" href="css/leaflet.less" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
		<script>
		var arrEvent=<?php echo  $arrEvent; ?>;
		var text="";
		var c=0;
		var color;
		var coll;
		var ico;
		function unparseTime(t){ //разпарсинг даты
            var arr=[];
            arr=t.split("");
            var realTime;
            realTime=arr[4]+arr[5]+"/"+arr[2]+arr[3]+"/"+arr[0]+arr[1]+" "+arr[6]+arr[7]+":"+arr[8]+arr[9]+":"+arr[10]+arr[11];

            return realTime;
        };
		
	
		
		for(var i=0; i<arrEvent.length; i++){
			if(c==0){
			c++;
			color="#ebf1f2";
			}else{
			color="#c7eaef";
			c=0;
			}
			
			
			
			
			coll=arrEvent[i].split("#");
			if(coll[2]=="accident"){
			ico="<img src='images/mrk_dtp.png' height='20px' alt='ДТП'>"
			}
			if(coll[2]=="malfunction"){
			ico="<img src='images/mrk_malfunction.png' height='20px' alt='поломка'>"
			}
			
			
			text+="<tr><td style='margin:5px; background-color: "+color+"'>"+coll[0]+"</td><td align = 'center' style='margin:5px; width: 150px;background-color: "+color+"'>"+unparseTime(coll[1])+"</td><td style='margin:5px; background-color: "+color+"'>"+ico+" </td><td style='margin:5px; background-color: "+color+"'> "+coll[3]+"</td></tr>";
			
			
			
		
		}
		var height=arrEvent.length*1.6;
		
		$(document).ready(function(){
            document.getElementById("div_st").innerHTML = text;
			document.getElementById("div").style.height = height+"em";
        });
		
		
		
		
		
	//	alert (arrEvent.length);
		
		</script>
		
		
	
    </head>
    <body id ="index" >
		<p align="center" style="color: white">Статистика</p>
			<div align = "center" width="1000px" style=" box-shadow: 0px 0px 10px #ffffff; width: 1000px; margin: 10px auto; background-color: #d2f0f4">
				<div align="left" id="div" style="margin: 10px">
					<table align="left" id="div_st" style="margin: 10px" cellpadding="5" cellspacing="5">
							
					</table >
				
				
				
					
			
				</div> 
			</div>
	</body>

	
</html>